<script>
export default {
  name: "Shop",
  methods: {
    handleClick(row) {
      console.log(row);
    },
    findAll: function () {
      this.$axios.get("/shop/findAll").then((res) => {
        if (res.data.code === 1) {
          this.tableData.data = res.data.data;
        }
      })
    }
  },
  mounted() {
    this.findAll();
  },
  data() {
    return {
      tableData: [{
      }]
    }
  }
}
</script>

<template>
  <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      prop="shopName"
      label="商品名称"
      width="180">
    </el-table-column>
    <el-table-column
      prop="shopPrice"
      label="商品价格"
      width="180">
    </el-table-column>
    <el-table-column
      prop="shopNumber"
      label="商品数量">
    </el-table-column>
    <el-table-column
      prop="shopPic"
      label="商品图片">
    </el-table-column>
    <el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<style scoped>

</style>
